function postRequest(url, data) {
  return fetch(url, {
    body: JSON.stringify(data),
    method: 'POST',
    cookie: 'fdsafsda',
    headers: {
      'Content-Type': 'application/json',
      token: localStorage.getItem('token')
    }

  }).then(response => response.json());//对返回的数据进行解析
}

function getRequest(url) {
  return fetch(url, {
    method: 'GET',
    cookie: 'fdsafsda',
    headers: {
      'Content-Type': 'application/json',
      token: localStorage.getItem('token')
    }

  }).then(response => response.json());//对返回的数据进行解析
}
